home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / lib / gcc-lib / ppc-amigaos / 2.95.1 / include / typeinfo < prev    next >
Text File  |  2000-03-13  |  1KB  |  59 lines

  1. // RTTI support for -*- C++ -*-
  2. // Copyright (C) 1994, 95-97, 1998 Free Software Foundation
  3.  
  4. #ifndef __TYPEINFO__
  5. #define __TYPEINFO__
  6.  
  7. #pragma interface "typeinfo"
  8.  
  9. #include <exception>
  10.  
  11. extern "C++" {
  12.  
  13. namespace std {
  14.  
  15. class type_info {
  16. private:
  17.   // assigning type_info is not supported.  made private.
  18.   type_info& operator= (const type_info&);
  19.   type_info (const type_info&);
  20.  
  21. protected:
  22.   explicit type_info (const char *n): _name (n) { }
  23.  
  24.   const char *_name;
  25.  
  26. public:
  27.   // destructor
  28.   virtual ~type_info ();
  29.     
  30.   bool before (const type_info& arg) const;
  31.   const char* name () const
  32.     { return _name; }
  33.   bool operator== (const type_info& arg) const;
  34.   bool operator!= (const type_info& arg) const;
  35. };
  36.  
  37. inline bool type_info::
  38. operator!= (const type_info& arg) const
  39. {
  40.   return !operator== (arg);
  41. }
  42.  
  43. class bad_cast : public exception {
  44. public:
  45.   bad_cast() { }
  46.   virtual ~bad_cast() { }
  47. };
  48.  
  49. class bad_typeid : public exception {
  50.  public:
  51.   bad_typeid () { }
  52.   virtual ~bad_typeid () { }
  53. };
  54.  
  55. } // namespace std
  56.  
  57. } // extern "C++"
  58. #endif
  59.